<template>
    <div>
        <header class="resviseTop">
            <img src="../../images/left.png" alt="" @click="$router.back(-1)">
            <span class="resvise_title">绑定任务号</span>
        </header>
        <div>
            <ul id="bindingTab">
                <li v-for="type in tab" class="clearfix" @click="routerTao(type.platform_id, type.platform_name,type.platform_tag)" v-if="type.platform_tag != 'tianmao'">
                    <img src="@/images/Icon_tb.png" alt="" class="fl" v-if="type.platform_tag == 'taobao'">
                    <img src="@/images/Icon_pdd.png" alt="" class="fl" v-else-if="type.platform_tag == 'pinduoduo'">
                    <img src="@/images/Icon_jd.png" alt="" class="fl" v-else-if="type.platform_tag == 'jd'">
                    <span>{{ type.platform_name }}</span>
                    <img src="@/images/right.png" alt="" class="fr">
                </li>
            </ul>
        </div>
        <div class="fixed_color"></div>
    </div>
</template>

<script>
    import api from '../../utils/api';

    export default {
        name: "Login",
        data (){
            return {
                tab: []
            }
        },
        methods: {
            routerTao(type, title, platform_tag) {
                this.$router.push({
                    path: '/task/bindingTao',
                    query: {
                        platform_id: type,
                        title: title,
                        platform_tag: platform_tag
                    }
                })
            }
        },
        async created(){
            var _that = this;
            await api.request('/platforms', 'get', {}).then(function(res) {
                _that.tab = res.data.data;
            })
        },
    }
</script>

<style scoped="css">
    @import "../../style/bindingTao.css";
    @import "../../style/public.css";

    .fixed_color {
        background: #f2f2f2;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
    }
</style>
